public class PassByExample {
	
	String name = 'Rao Tumma';
	SomeInnerClass innerClassObj = new SomeInnerClass(100, 'Rao Tumma');
	
	public void displayName(){
		system.debug('NAME => ' + name);
	}
	
	public void takeNameAsArg(String value){
		value = value + ' Some thing is appended ...';
		system.debug('INSIDE takeNameAsArg() NAME => ' + value);
	}
	
	public void takeObjectAsArg(SomeInnerClass innerClassObj){
		innerClassObj.i = innerClassObj.i + 100;
		innerClassObj.s = innerClassObj.s + ' Some thing is appended ...';  
		innerClassObj.displayValues();
	}
	
	public void showHowItWorks(){
		// Pass by Value
		displayName();
		takeNameAsArg(name);
		displayName();
		
		// Pass by Reference 
		innerClassObj.displayValues();
		takeObjectAsArg(innerClassObj);
		innerClassObj.displayValues();
		
	}
	
		
	// Inner class
	Class SomeInnerClass{
		public Integer i;  	
		public String s;
		
		public SomeInnerClass(Integer intvalue, String strvalue){
			i = intvalue;
			s = strvalue;
		}
				
		public void displayValues(){
			System.debug('Value of i is ' + i + 'Value of s is ' + s);
		}
	}
}